package design.singleton.version04;

public class Singleton {
    private static Singleton Instance = new Singleton();

    private Singleton(){
        System.out.println("Singleton");
    }

    public static Singleton getInstance(){
        return Instance;
    }
}
class TestSingleton{
    public static void main(String[] args){
        Singleton s1 = Singleton.getInstance();

        Singleton s2 = Singleton.getInstance();

        Singleton s3 = Singleton.getInstance();

        System.out.println(s1 == s2);
    }
}
